package org.assistant.sample.evolution;

import java.util.Date;
import java.util.TimeZone;
import java.text.DateFormat;
import java.text.SimpleDateFormat;


public class Wintor extends Individual {
	private Date timestamp;
	private String direction; 
	private int speed_n;
	private String speed_u;
	
	public Wintor(String direction, int speed_n, String speed_u, Date timestamp){
		this.direction = direction;
		this.speed_n = speed_n;
		this.speed_u = speed_u;
		this.timestamp = timestamp;
	}
	
	public String getDirection() {
		return direction;
	}

	public int getSpeed() {
		return speed_n;
	}

	public String getSpeedUnit() {
		return speed_u;
	}

	public Date getTimestamp() {
		return timestamp;
	}

	public String getTimestampStr() {
		DateFormat dateFormat = new SimpleDateFormat("MMM dd, yyyy HH:mm:ss aaa");
		dateFormat.setTimeZone(TimeZone.getTimeZone("America/New_York"));		
		return dateFormat.format(timestamp);
	}

	public String getTimestampDateStr() {
		DateFormat dateFormat = new SimpleDateFormat("MMM dd, yyyy");
		dateFormat.setTimeZone(TimeZone.getTimeZone("America/New_York"));		
		return dateFormat.format(timestamp);
	}

	public String getTimestampTimeStr() {
		DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss aaa");
		dateFormat.setTimeZone(TimeZone.getTimeZone("America/New_York"));		
		return dateFormat.format(timestamp);
	}

	public String toString(){
		String result = "";
		result += "Direction: " + direction +"; ";
		result += "Speed: " + speed_n + speed_u +"; ";
		DateFormat dateFormat = new SimpleDateFormat("MMM dd, yyyy HH:mm:ss aaa");
		dateFormat.setTimeZone(TimeZone.getTimeZone("America/New_York"));		
		result += "Timestamp: " + dateFormat.format(timestamp) +".";
		return result;
	}
	
}
